<template>
    <div>
        <div class="input-control search-box search-box-circle has-icon-left has-icon-right maAndW">
             <el-input placeholder="请输入影片名" v-model="search" class="input-with-select">
             <el-button slot="append" icon="el-icon-search" @click="find()"></el-button>
             </el-input>
        </div>
    <hr>
     <el-table :data="result" style="width: 100%" > 
         
      <el-table-column prop="vname" label="影片名" width="300" align="center">
      </el-table-column>
      <el-table-column prop="vactor" label="主演" align="center">
      </el-table-column>
      <el-table-column prop="vintroduce" label="简介" align="center">
      </el-table-column>
      <el-table-column fixed="right" label="访问" width="150" align="center">
        <template slot-scope="scope">
          <el-button @click="togo(scope.row)"><i class="el-icon-s-promotion"></i></el-button><br>
        </template>
      </el-table-column>
    </el-table>
    </div>

</template>

<script>
    export default {
        name: '',
        data() {
            return {
                search:"",
                result:[],
               
            }
        },
        methods: {
            find(){
            this.$axios.get('findvideoList.do?search='+this.search).then(response => {
            this.result = response.data
                console.log(this.result);
                 console.log(this.search);
            }).catch(function (error) {
                console.log(error);
            })
            },
            togo(video){
                this.$router.push({
                  path:"/VideoDatail",
                  params:{id:video.vid}
              })
            }
        },
        components: {},
        mounted() {
        this.$axios.get('videoslList.do').then(response => {
        this.result = response.data
        console.log(this.videos);
        }).catch(function (error) {
        console.log(error);
      })}
    }
</script>

<style scoped>
    .maAndW {
        margin-top: 100px;
    }
    
</style>